<template>
  <div class="plugin-goods scroll-box">
    <el-menu class="nav" mode="horizontal" :default-active="route.path" router>
      <el-menu-item index="/plugin/goods">{{ plugin.lang('nav.0') }}</el-menu-item>
      <el-menu-item index="/plugin/goods/create">{{ plugin.lang('nav.1') }} ({{ createModel.getList().length }})</el-menu-item>
      <el-menu-item index="/plugin/goods/inbound">{{ plugin.lang('nav.2') }}</el-menu-item>
      <el-menu-item index="/plugin/goods/label">{{ plugin.lang('nav.3') }}</el-menu-item>
    </el-menu>
    <el-scrollbar>
      <router-view />
    </el-scrollbar>
  </div>
</template>

<script>
import { useRoute } from 'vue-router'
import app from '@/app'
import createModel from './model/create'

export default {
  setup() {
    // 当前路由
    const route = useRoute()

    return {
      plugin: app.plugin.index,
      route,
      createModel
    }
  }
}
</script>